home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pdox693.zip / TI499.ASC < prev    next >
Text File  |  1992-08-12  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox                                NUMBER  :  499
  9.   VERSION  :  All
  10.        OS  :  DOS
  11.      DATE  :  August 12, 1992                          PAGE  :  1/1
  12.  
  13.     TITLE  :  USING IMAGECSUM() TO CALCULATE A COLUMN IN A FORM
  14.  
  15.  
  16.  
  17.  
  18.   The following script demonstrates a method for calculating the
  19.   total of a particular column in a multi-record form.  The example
  20.   below illustrates the use of the IMAGECSUM() function.
  21.  
  22.  
  23.  
  24.   EDIT "Orders"
  25.   PICKFORM 1
  26.   WHILE TRUE
  27.  
  28.   WAIT TABLE
  29.   PROMPT "PRESS [F2] TO SAVE CHANGES, [ESC] TO CANCEL CHANGES",
  30.          "[CTRL] [N] TO CALCULATE TOTAL QUANTITY"
  31.   UNTIL "F2", "ESC", 14
  32.   SWITCH
  33.      CASE RETVAL=14:                  ;if the user presses Ctrl-N
  34.         fld=FIELD()                   ;sets current field to fld
  35.         MOVETO [Quantity Ordered]
  36.         x=IMAGECSUM()                 ;calculates Total Quantity
  37.                                       ;Ordered
  38.         MESSAGE "The total quantity is ", x, ".  Press any key to
  39.                  continue"
  40.         y=GETCHAR()
  41.         EXECUTE "MOVETO ["+ fld +"]"  ;moves back to original field
  42.      CASE RETVAL="Esc": CANCELEDIT QUITLOOP  ;cancels edit mode
  43.      CASE RETVAL="F2": DO_IT! QUITLOOP       ;saves changes
  44.   ENDSWITCH
  45.   ENDWHILE
  46.  
  47.   DISCLAIMER: You have the right to use this technical information
  48.   subject to the terms of the No-Nonsense License Statement that
  49.   you received with the Borland product to which this information
  50.   pertains.
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.